package com.ysccc.shares.schedule;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.ysccc.shares.service.SharesService;
import com.ysccc.tools.Dates;

import lombok.extern.slf4j.Slf4j;

@Component
@Transactional
@Slf4j
public class SharesSchedule {
	
	@Autowired
	private SharesService sharesService;

	@Scheduled(cron = "0 20 16 * * *")
	public void daily() {
		log.info("定时执行获取股票信息的任务");
		Date now = Dates.now();
		sharesService.dailyReport(now);
		sharesService.alertSalsShares(now);
		log.info("执行完啦");
	}
}
